package com.c.ctgproject.ui.storage.material

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.c.ctgproject.base.BaseViewModel
import com.c.ctgproject.http.ApiMethods
import com.c.ctgproject.utils.awaitSync
import com.c.ctgproject.utils.handlerBody
import com.c.ctgproject.utils.launch
import com.c.ctgproject.utils.userToken

class StorageMaterialOutViewModel : BaseViewModel() {
    private val mDetail = MutableLiveData<String>()
    val detail: LiveData<String> get() = mDetail


    fun getList(page: Int, size: Int) {
        launch({
            mDetail.value =
                    ApiMethods.getApiService().getStorageMaterialOut(userToken, page, size).awaitSync()
        }, {
            mError.value = it.message.toString()
        })
    }




}